{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}
<tr id="student-{{ user.id }}-tr">
	<td class="media">
		{{ web_macro.user_avatar(user, 'pull-left') }}
		<a target="_blank" href="{{ path('user_show', {id:user.id}) }}">{{ user.nickname }}</a>
		{% if student.remark %}
			<span class="text-muted text-sm" title="{{student.remark}}">({{ student.remark|plain_text(16) }})</span>
		{% endif %}
		<div class="text-muted text-sm">加入时间：{{ student.createdTime|date('Y-n-d H:i') }}</div>
		{% if course.expiryDay > 0 and student.deadline > 0 %}
			<div class="text-muted text-sm">有效期至：{{ student.deadline|date('Y-n-d H:i') }} ({{ student.deadline|remain_time }})</div>
		{% endif %}
	</td>

	<td>
		<div class="progress" title="已学{{ progress.number }}课时">
			<div class="progress-bar" style="width: {{ progress.percent }}">
			</div>
		</div>
	</td>

	<td>


		<div class="btn-group">
			{% if app.user.id != user.id %}
					<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal" data-url="{{path('message_create', {toId:user.id})}}">发私信</button>
				{% endif %}
				{% if app.user.isAdmin() %}
					<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal" data-url="{{path('course_manage_students_show', {courseId:course.id, userId:user.id})}}">查看资料</button>
				{% elseif setting("course.buy_fill_userinfo") %}
					<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal" data-url="{{path('course_manage_students_defined_show', {courseId:course.id, userId:user.id}) }}">查看资料</button>
				{% endif %}
			<a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">管理
				<span class="caret"></span>
			</a>
			<ul class="dropdown-menu pull-right">
				<li><a class="" href="" data-toggle="modal" data-target="#modal" data-url="{{path('course_manage_student_remark', {courseId:course.id, userId:user.id})}}">备注</a></li>
				{% if app.user.id != user.id %}
					<li>
					<a class="follow-student-btn" href="javascript:;" data-url="{{ path('user_follow', {id:user.id}) }}" {% if isFollowing %} style="display:none;"{% endif %}>关注</a>
						<a class="btn-success unfollow-student-btn" href="javascript:;" data-url="{{ path('user_unfollow', {id:user.id}) }}" {% if not isFollowing %} style="display:none;"{% endif %}>已关注</a>
						</li>
				{% endif %}
				{% if app.user.isAdmin() or  app.user.isTeacher() and  isTeacherAuthManageStudent == 1 and course.expiryDay > 0 %}
					<li><a class="" href="" data-toggle="modal" data-target="#modal" data-url="{{path('course_set_expiryday', {courseId:course.id, userId:user.id})}}">增加有效期</a></li>
				{% endif %}

				{% if app.user.isAdmin() or  app.user.isTeacher() and  isTeacherAuthManageStudent == 1 %}
					<li><a class="student-remove" href="javascript:;" data-url="{{path('course_manage_student_remove', {courseId:course.id, userId:user.id})}}">移除</a></li>
				{% endif %}
			</ul>
		</div>
	</td>
</tr>